<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<form id="pagerForm" method="get" model="viewRequest" action="#rel#">
	<input type="hidden" name="viewRequest.page" value="${page.number}" />
	<input type="hidden" name="viewRequest.size" value="${page.size}" />
	<c:forEach items="${viewRequest.params}" var="params">
		<input type="hidden" id="${params.key}" name="viewRequest.params['${params.key}']" value="${params.value}" />
	</c:forEach>
	<c:forEach items="${viewRequest.sort}" var="sort">
		<input type="hidden" name="viewRequest.sort.${sort.key}" value="${sort.value}" />
	</c:forEach>
</form>

<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return flow_navSearch(this);" action="${rootUrl}/goods/inventory-flow?goodsId=${goodsId}" method="get">
	<div class="searchBar">
		<ul class="searchContent">
			<li>
				<label>商品名称：</label>
				<input type="hidden" id="flowIndexGoodsId" name="goods.id" value="${viewRequest.params['_and_i_dot_goodsId_eq_number'] }"/>
				<input type="text" id="flowIndexGoodsName" name="goods.name" style="float:left" value="${ goodsName}"/>
				<a class="btnLook" href="${rootUrl}/goods/goods/1/dialog" width="1300" height="720" lookupGroup="goods">商品名称</a>
			</li>
			<li style="width: 500px">
				<label>时间：</label>
				<input name="viewRequest.params['_and_i_dot_createdAt_ge_string']" type="text" class="date" dateFmt="yyyy-MM-dd HH:mm:ss" size="20" value="${viewRequest.params['_and_i_dot_createdAt_ge_string'] }" placeholder="开始时间"/>
				<input name="viewRequest.params['_and_i_dot_createdAt_le_string']" type="text" class="date" dateFmt="yyyy-MM-dd HH:mm:ss" size="20" value="${viewRequest.params['_and_i_dot_createdAt_le_string'] }" placeholder="结束时间"/>
			</li>
		</ul>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
				<%-- <li><a class="button" href="${rootUrl}/goods/goodsSku!search" target="searchDialog" targetType="dialog" parentDialogId="goods" mask="true" title="查询框"><span>高级检索</span></a></li> --%>
			</ul>
		</div>
	</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
		</ul>
	</div>
	<table class="table" targetType="dialog"  width="100%" layoutH="135">
		<thead>
			<tr>
				<th width="160">商品名称</th>
				<th width="160">商品规格</th>
				<th width="120">库存变化数</th>
				<th width="120">变化后库存</th>
				<th width="160">操作员</th>
				<th width="120">时间</th>
				<th width="220">备注</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.content}" var="inventoryflow" varStatus="status">
			<tr target="data_id" >
				<td>${inventoryflow[0]}</td>
				<td>${inventoryflow[1]}</td>
				<td>${inventoryflow[2]}</td>
				<td>${inventoryflow[3]}</td>
				<td><c:if test="${inventoryflow[5] == null}">系统操作</c:if><c:if test="${inventoryflow[5] != null}">${inventoryflow[5]}</c:if></td>
				<td><fmt:formatDate value="${inventoryflow[6]}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				<td>${inventoryflow[4]}</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
				<option value="${page.size}">${page.size}</option>
				<option value="20">20</option>
				<option value="50">50</option>
				<option value="100">100</option>
				<option value="200">200</option>
			</select>
			<span>条，共${page.totalElements}条 </span>
		</div>
		<div class="pagination" targetType="navTab" totalCount="${page.totalElements}" numPerPage="${page.size}" pageNumShown="10" currentPage="${page.number}"></div>
	</div>
</div>
<script>
	function flow_navSearch(obj){
		$("#flowIndexGoodsId").attr("name","viewRequest.params['_and_i_dot_goodsId_eq_number']");
		$("#flowIndexGoodsName").attr("name","goodsName");
		
		return navTabSearch(obj);
	}
</script>